<?php
namespace app\index\controller;
use app\BaseController;
use think\facade\Db;
class Tools extends Base{

    //因为在些小伙伴在测试功能的时候，会把把密码修改掉
    //所以有了重置后台的登录密码方法，重置后为123456
    public function resetAdmin(){
        Db::table('an_admin')
        ->where('id',9)
        ->update(['pass'=>'74b794fc074876a56c1895c35a549c2b']);
    }

    //根据key获取系统配置
    public function getConfig($key){
        $data = $this->formatConfig($key);
        $this->info['data'] = $data['value'];
        $this->info['msg'] = $data['title'];
        $this->info['id'] = $data['id'];
        return json($this->info);
    }
}
